package wibrst.utils{
	/**
	 * ...
	 * @author wibrst@qq.com
	 */
	public class StatUtil{
		
		static public function getCombOf( nPick:Number, nTotal:Number ):Number {
			//return n > m?MathUtil.factorial(n) / MathUtil.factorial(m) / MathUtil.factorial( n - m ):1;
			
			var nResult:Number = getPermOf( nPick, nTotal );
			
			for ( var i:Number = 2; i <= nPick; i++ ) {
				nResult = nResult / i;
			}
			return nResult;
		}
		
		static public function getPermOf( nPick:Number, nTotal:Number ):Number {
			var nResult:Number = 1;
			for ( var i:Number = nTotal - nPick + 1; i <= nTotal; i++ ) {
				nResult = nResult * i;
			}
			return nResult;
		}
		
	}

}